<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input{
            outline: none;
        }
    </style>
</head>

<body>
    请输入今天星期几<input type="text" class="int">
    <button class="btn">今天吃什么</button>
    <script>
        var btn = document.getElementsByClassName("btn")[0];
        var inp = document.getElementsByClassName("int")[0];
        btn.onclick=function(){
            var res = inp.value;
            if(res==1){
                alert("西红柿炒鸡蛋")
            }
            else if(res==2){
                alert("鸡蛋抄西红柿")
            }
            else if(res==3){
                alert("KFC")
            }
            else if(res==4){
                alert("MMD")
            }
            else if(res==5){
                alert("麻辣香锅")
            }
            else if(res==6){
                alert("海底捞")
            }
            else if(res==7){
                alert("家常菜")
            }
            else{
                alert("请填写正确的日期")
            }
        }
    </script>

</body>

</html>